home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Prg / STDM20.ZIP / ADDON.TXT next >
Text File  |  1997-09-14  |  12KB  |  346 lines

  1.  
  2.              StDemo Player 2.0 
  3.     Copyright (c) 1993-1995 MIKSoft, Inc.
  4.  
  5.       --------------------------------
  6.       | MIKSoft, Inc.                |
  7.       | 37 Landsdowne Rd,            |
  8.       | East Brunswick, NJ 08816     |
  9.       | USA                          |
  10.       | Internet:  mik@cnj.digex.com |
  11.       | CompuServe: [74127,3671]     |
  12.       | Tel/Fax: (908) 390 8986      |
  13.       --------------------------------
  14.  
  15. Description of StDemo Player Professional Edition
  16. =================================================
  17.  
  18. The feature described below is not included in the shareware
  19. version of StDemo Player. If you are interested in this add-on,
  20. you may order it when you register StDemo Player.
  21.  
  22. Professional Edition doesn't impose limits on keyboard/mouse simulation.
  23. In "standard" version some keys are impossible to simulate (for example, 
  24. pressing Alt alone, i.e. not as a modifier to some other key) and mouse 
  25. simulations are limited to the client area of a window only. There are
  26. some other cases when mouse simulation wouldn't work, drag-and-drop from 
  27. File Manager, for instance. Professional version allows any simulation.
  28.  
  29. StDemo Pro allows to simulate all keyboard and mouse events using Windows
  30. journal capabilities. The command to use is:
  31.  
  32. :"<string>
  33.  
  34. <string> contains the list of codes which describe desired actions.
  35.  
  36. <string> can be splited into several lines using the continuation symbol "\",
  37. for example:
  38.  
  39. :"this is the text
  40.  
  41. is equal to
  42.  
  43. :"this \
  44. is \
  45. the \
  46. text
  47.  
  48. Keyboard events are simulated by sending one or more keystrokes to the 
  49. active window as if they had been entered at the keyboard.
  50. Each key is represented by one or more characters.  To specify a single 
  51. keyboard character, use the character itself.  For example, to represent the 
  52. letter a, use "a" for <string>.  If you want to represent more than one character,
  53. append each additional character to the one preceding it.  To represent the 
  54. letters a, B, and c, use "aBc" for <string>.
  55.  
  56. The plus sign (+), caret (^), percent sign (%), tilde (~), braces { }, 
  57. and parentheses ( ) have special meanings inside the <string>.  To specify one of these 
  58. characters, enclose it inside braces.  For example, to specify the plus sign, use {+}.  
  59. To send brace characters, use {{} and {}}.
  60.  
  61. To specify characters that aren't displayed when you press a key (such as 
  62. Enter or Tab) and keys that represent actions rather than characters, use the 
  63. codes shown below:
  64.  
  65. Key             Code
  66. ---             ----    
  67. Backspace       {BACKSPACE} or {BS} or {BKSP}    
  68. Caps Lock       {CAPSLOCK}    
  69. Clear           {CLEAR}
  70. Del             {DELETE} or {DEL}    
  71. Down Arrow      {DOWN}
  72. End             {END}    
  73. Enter           {ENTER} or ~
  74. Esc             {ESCAPE} or {ESC}    
  75. Help            {HELP}
  76. Home            {HOME}    
  77. Ins             {INSERT}
  78. Left Arrow      {LEFT}    
  79. Num Lock        {NUMLOCK}
  80. Page Down       {PGDN}    
  81. Page Up         {PGUP}
  82. Pause           {PAUSE}    
  83. Print Screen    {PRTSC}    
  84. Right Arrow     {RIGHT}
  85. Scroll Lock     {SCROLLOCK}    
  86. Space           {Space} or {Blank}
  87. Tab             {TAB}
  88. Up Arrow        {UP}    
  89. F1              {F1}
  90. F2              {F2}    
  91. F3              {F3}
  92. F4              {F4}    
  93. F5              {F5}
  94. F6              {F6}    
  95. F7              {F7}
  96. F8              {F8}    
  97. F9              {F9}
  98. F10             {F10}    
  99. F11             {F11}
  100. F12             {F12}    
  101. F13             {F13}
  102. F14             {F14}    
  103. F15             {F15}
  104. F16             {F16}        
  105.  
  106. To specify keys combined with any combination of Shift, Ctrl, and Alt keys, 
  107. precede the regular key code with one or more of the following codes:
  108.  
  109. Key         Code
  110. ---         ----
  111. Shift       +
  112. Control     ^
  113. Alt         %
  114.  
  115. To specify that Shift, Ctrl, and/or Alt should be held down while several other 
  116. keys are pressed, enclose the keys' code in parentheses.  For example, to have 
  117. the Shift key held down while word "code" is being typed, use "+(code)". It has 
  118. the same effect as using "CODE". Pay attention to the case of the letters when using
  119. + modifier. It actually reverses the case. For example, +(CODE) will produce "code".
  120.  
  121. To have two modifiers to be applied to the keystroke, precede the keystroke with
  122. both, i.e. "^+{End}" means Ctrl-Shift-End.
  123.  
  124. To simulate pressing Shift, Alt or Ctrl alone use the form %(), +() or ^().
  125.  
  126. To specify repeating keys, use the form {key number};  you must put a space 
  127. between key and number.  For example, {LEFT 4} means press the Left 
  128. Arrow key 4 times; {SPACE 10} means press space 10 times; 
  129. {a 5} means press "a" 5 times.
  130.  
  131.  
  132. Mouse events are simulated by using one or more special codes in the
  133. <string>.
  134.  
  135. Action                          Code
  136. ------                          ----    
  137. LeftButtonClick                 {Lclick}
  138. RightButtonClick                {Rclick}
  139. MiddleButtonClick               {Mclick}
  140. LeftButtonDoubleClick           {LDclick}
  141. RightButtonDoubleClick          {RDclick}
  142. MiddleButtonDoubleClick         {MDclick}
  143. MoveMouse                       {Move}
  144. DragWithLeftButton              {LDrag}
  145. DragWithRightButton             {RDrag}
  146. DragWithMiddleButton            {MDrag}
  147.  
  148.  
  149. "Drag" means moving the mouse with the button held pressed.
  150.  
  151. Double-click might be coded as {LClick 2}. Make sure that the current
  152. delay applied between events is small enough.
  153.  
  154. Mouse move and drag commands have "parameters" coded as numbers separated by space
  155. or "|" after the code inside the braces. First two represent the X and Y coordinates
  156. of the point where mouse movement ends. (It starts from the current cursor position).
  157. The third parameter (optional, 1 by default) shows in how many steps this movement
  158. will be executed, i.e. how many "jumps" mouse cursor will make.
  159.  
  160. The following example shows how to draw a square in the Paintbrush:
  161. {Move 200|200}{LDrag 300|200|2}{LDrag 300|300|2}{LDrag 200|300|2}{LDrag 200|200|2}
  162.  
  163. Coordinates may be expressed as "relative" if they are preceded with "+" or "-" sign.
  164. "*" represents the current coordinate.
  165.  
  166. The previous example might be modified as follows using relative coordinates:
  167. {Move 200|200}{LDrag +100|*|2}{LDrag *|+100|2}{LDrag -100|*|2}{LDrag *|-100|2}
  168.  
  169. Alt/Ctrl/Shift modifiers may be used with the mouse simulation codes in the same
  170. way as with the keyboard simulation codes.
  171.  
  172. When using coordinates, it is very important to understand and use the proper scheme 
  173. of coordinate origin and scaling. 
  174. Selecting appropriate coordinates origin allows to make your mouse simulation
  175. commands invariant to the window's position on a desktop.
  176. Selecting appropriate coordinates scaling allows to make your mouse simulation
  177. commands invariant to the window's size and/or the resolution of the screen.
  178.  
  179. There are some special codes to define origin and scaling.
  180.  
  181. Action                          Code
  182. ------                          ----    
  183. Set coordinate origin           {Origin}
  184. Set coordinates scaling         {Virtsize}
  185.  
  186. The following codes represent all possible cases of using coordinates origin:
  187.  
  188. {Origin Desktop}
  189.     The coordinates origin (0,0) is in the upper left corner of the desktop.
  190.  
  191. {Origin Window Active}
  192.     The coordinates origin (0,0) is in the upper left corner of the window area
  193.     of the currently active window.
  194.  
  195. {Origin Window Focus}
  196.     The coordinates origin (0,0) is in the upper left corner of the window area
  197.     of the window which currently owns focus.
  198.  
  199. {Origin Window Class|<classname>}
  200.     The coordinates origin (0,0) is in the upper left corner of the window area
  201.     of the window which classname matches given <classname> string. 
  202.  
  203. {Origin Window Caption|<caption>}
  204.     The coordinates origin (0,0) is in the upper left corner of the window area
  205.     of the window which caption matches given <caption> string. 
  206.  
  207. {Origin Client Active}
  208. {Origin Client Focus}
  209. {Origin Client Class|<classname>}
  210. {Origin Client Caption|<caption>}
  211.     All these cases are the same as for "Window" but the origin starts in the upper left
  212.     corner of the client area.
  213.     
  214. Coordinates scaling might be defined using the following form:
  215.  
  216. {VirtSize X|Y}
  217.  
  218. where X and Y are numbers representing the virtual size of the area chosen by
  219. {Origin} command. For example, if origin refers to the desktop - virtual size
  220. defines the size of the screen, if origin is "window" - virtual size refers
  221. to the size of the window area, if origin is "Client" - virtual size refers to
  222. the size of a client area. 
  223.  
  224. If virtual size defined as {Virtsize *|*} then all coordinates are treated as
  225. absolute. This is the default setting for VirtSize. 
  226. Otherwise coordinates are scaled to the correspondent desktop/window/client
  227. virtual size.
  228.  
  229. For example, to divide the paint area of the PaintBrush into four equal quarters, 
  230. the following sequence might be used:
  231.  
  232. :"{Origin Client Class|pbPaint}{VirtSize 1000 1000}{Move 0 500}{LDrag 1000 500}{Move 500 0}{LDrag 500 1000}
  233.  
  234. NOTE
  235. ----
  236.     {Origin} and {Virtsize} codes have LOCAL scope -- they affect only commands in the
  237. same :" line where they were coded. If subsequent :" commands don't have {Origin}/{VirtSize},
  238. GLOBAL values for them will be used. These global values are set with :O and :S
  239. commands. (Refer to the readme.txt).
  240.  
  241. Examples:
  242.  
  243. :OSWV
  244. :S1000|1000
  245. ....
  246. equal to
  247. :"{Origin Desktop}{VirtSize 1000 1000}.......
  248.  
  249.  
  250. :OACA
  251. ....
  252. equal to
  253. :"{Origin Client Active}{VirtSize *|*}.......
  254.  
  255.  
  256. :OFW
  257. :S100|100
  258. ....
  259. equal to 
  260. :"{Origin Window Focus}{VirtSize 100|100}.......
  261.  
  262.  
  263. Raw keyboard and mouse events can be simulated by using one or more 
  264. of special codes in the string:
  265. LeftButtonDown      {LeftDown x|y}
  266. LeftButtonUp        {LeftUp x|y}
  267. RightButtonDown     {RightDown x|y}
  268. RightButtonUp       {RightUp x|y}
  269. MiddleButtonDown    {MiddleDown x|y}
  270. MiddleButtonUp      {MiddleUp x|y}
  271. KeyPress            {KeyDown virtual_key_code}
  272. KeyRelease          {KeyUp virtual_key_code}
  273.  
  274.  
  275. The following example demonstrates using of the :" command...
  276.  
  277. ------------------cut here-------------------------
  278. :C11
  279. :I11
  280. :=100
  281. :(pbrush.exe
  282. :#S
  283. Let's draw some figures in Paintbrush
  284. #
  285. :"{Origin Client Class|pbPaint}{VirtSize 100 100}{Move 0 50}{LDrag 100 * 10}{Move 50 0}{LDrag * 100 10}
  286. // select circle tool
  287. :"{Origin Client Class|pbTool}{VirtSize 4 18}{Move 1 15}{LClick}
  288. // Draw several ellipses in different colors
  289. :"{Origin Client Class|pbColor}{VirtSize 32 4}{Move 9 1}{LClick}
  290. :"{Origin Client Class|pbPaint}{VirtSize 100 100}{Move 40 40}{LDrag 60 60}
  291. :"{Origin Client Class|pbColor}{VirtSize 32 4}{Move 11 1}{LClick}
  292. :"{Origin Client Class|pbPaint}{VirtSize 100 100}{Move 30 30}{LDrag 70 70 4}
  293. :"{Origin Client Class|pbColor}{VirtSize 32 4}{Move 13 3}{LClick}
  294. :"{Origin Client Class|pbPaint}{VirtSize 100 100}{Move 20 20}{LDrag 80 80 100}
  295. :#S
  296. Closing paintbrush
  297. #
  298. :"%fxn
  299. // LcalcDemo
  300. :#S
  301. The following is the "calc" sample from script.txt expressed with :" notation.
  302. .S
  303. Note using the :O and :S commands to set GLOBAL Origin and VirtSize.
  304. #
  305. :LcalcDemo
  306. :(calc.exe
  307. :S324|283
  308. :OFC
  309. // View->Standard
  310. :"%vt
  311. // Clear
  312. :#S
  313. I'm going to move the cursor to the 'CLEAR' button - and click.
  314. #
  315. :"{Move 0|0}{Move 38|66|30}{LClick}
  316. // click 2
  317. :#S
  318. Now I'm going to move the cursor to the '2' button - and click.
  319. #
  320. :"{Move 135|196|30}{LClick}
  321. // click *
  322. :#S
  323. Now I'll move to the '*' button - and click.
  324. #
  325. :"{Move 242|152|30}{LClick}
  326. // click 3
  327. :#S
  328. And here we go to the '3' button - and click.
  329. #
  330. :"{Move 189|196|30}{LClick}
  331. // click =
  332. :#S
  333. Now I'm going to click on '=' and, truly, I'm expecting to get....
  334. #
  335. :"{Move 295|240|30}{LClick}
  336. :#S
  337. Don't tell me that the result is not equal to six, please!
  338. #
  339. :"%E{Left}{Down 5}{Enter}
  340. :#S
  341. Calc must be closed now.
  342. .S
  343. That's all.
  344. #
  345. ------------------cut here-------------------------
  346.